package com.alibaba.csp.sentinel.dashboard.rule.nacos;

/**
 * packageName com.alibaba.csp.sentinel.dashboard.rule.nacos.SystemRuleNacosPublisher
 *
 * @author liudonghai
 * @version JDK 11
 * @date 2025/8/1
 * @description TODO
 */

import com.alibaba.csp.sentinel.dashboard.config.NacosRuleConstants;
import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.SystemRuleEntity;
import com.alibaba.csp.sentinel.datasource.Converter;
import com.alibaba.nacos.api.config.ConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 系统规则 Nacos 发布者
 * 实现将系统规则发布到 Nacos 配置中心
 */
@Component("systemRuleNacosPublisher")
public class SystemRuleNacosPublisher extends NacosDynamicRulePublisher<SystemRuleEntity> {

    @Autowired
    public SystemRuleNacosPublisher(ConfigService configService,
                                       Converter<List<SystemRuleEntity>, String> converter) {
        super(configService, converter);
    }

    @Override
    protected String getDataIdPostfix() {
        return NacosRuleConstants.SYSTEM_DATA_ID_POSTFIX;
    }
}

